﻿<%@ Page Title="" Language="C#" MasterPageFile="~/OfficeMasterPage.Master" AutoEventWireup="true" CodeBehind="frmMedidas.aspx.cs" Inherits="EstoqueUnifeiADO.frmMedidas" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="Controles/ctrlItemMedidas.ascx" TagName="ctrlItemMedidas" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<table style="width: 98%">
        <tr>
            <td>
            <asp:ObjectDataSource ID="odsView" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="EstoqueUnifeiADO.Dados.dsMedidasTableAdapters.UNIDADETableAdapter"
                    DeleteMethod="Delete" OnDeleted="odsView_Deleted">
                    <DeleteParameters>
                        <asp:Parameter Name="Original_CODUNIDADE" Type="Int32" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
                <asp:ValidationSummary ID="vsForm" runat="server" BorderColor="Red" 
                    BorderStyle="Solid" BorderWidth="2px" ForeColor="Red"  />
                <br />
                <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Width="98%" 
                    onmenuitemclick="Menu1_MenuItemClick">
                    <Items>
                        <asp:MenuItem ImageUrl="~/images/Icones/application_form_add.png" Text="Novo" 
                            Value="Novo" ></asp:MenuItem>
                    </Items>
                </asp:Menu>
            </td>
        </tr>
        <tr>
            <td>
                
                <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    DataKeyNames="CODUNIDADE" DataSourceID="odsView" ForeColor="#333333" GridLines="None"
                    HorizontalAlign="Left" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                    OnRowCommand="gvList_RowCommand" Width="98%">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/Icones/application_form_magnify.png"
                                    CommandName="Select" ToolTip="Visualizar registro" CommandArgument="View" />
                                <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/Icones/application_form_edit.png"
                                    CommandName="Select" ToolTip="Alterar registro" CommandArgument="Edit" />
                                <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/images/Icones/delete.png"
                                    CommandName="Delete" ToolTip="Excluir registro" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="CODUNIDADE" HeaderText="Código" InsertVisible="False"
                            ReadOnly="True" SortExpression="CODUNIDADE" />
                        <asp:BoundField DataField="SIGLA" HeaderText="Sigla" InsertVisible="False"
                            ReadOnly="True" SortExpression="SIGLA" />
                        <asp:BoundField DataField="NOME" HeaderText="Descrição da unidade" SortExpression="NOME" />
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Button" style="display:none" />
                <asp:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" DynamicServicePath=""
                    Enabled="True" TargetControlID="Button1" BackgroundCssClass="modalBackground"
                    PopupControlID="pnlEdit">
                </asp:ModalPopupExtender>
                <br />
                <asp:Panel ID="pnlEdit" runat="server" BackColor="White" Width="400px">
                    <table style="width: 100%">
                        <tr style="text-align: right">
                            <td>
                                <asp:Button ID="Button2" runat="server" Text="X" ToolTip="Sair" OnClick="Button2_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <uc1:ctrlItemMedidas ID="ctrlItem" runat="server" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
